package com.lzl.controller;

import com.lzl.responese.ResponseResult;
import com.lzl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * //TODO
 *
 * @author zhaolinlin
 * @description //TODO
 * @createTime 2022/8/13 20:50
 */
@RestController
public class UserController {

    @Autowired
    UserService userService;


    @GetMapping("/user")
    public ResponseResult user(HttpServletRequest request){
        String accessToken = request.getHeader("Authorization");
        return userService.getUserByAccessToken(accessToken);
    }

}
